home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 4 (Reseller) / Apple Ref. & Pres. Lib.v4.0.iso / 1-Reference / User Groups DB / User Groups.res / User Groups.res.rsrc / 4DTE_15033 < prev    next >
Text File  |  1990-04-04  |  1KB  |  29 lines

  1. ChooseFile(Var;Str_Expr)
  2.    Var is an alphanumerical variable
  3.    Str_Expr is an alphanumeric expression
  4.  
  5. ChooseFile displays on the screen the standard dialog to open a document. Only files with the types specified by Str_Expr are shown.
  6.  
  7. If the user selects and opens a file, its full pathname is returned in the Var parameter. If the user clicks on the cancel button, an empty string is returned in Var.
  8.  
  9. If Str_Expr is an empty string, all types of documents are shown.
  10.  
  11. You specify the type(s) to be shown with a sequence of four characters which stand for the type of the file. You can specify up to 4 different types.
  12.  
  13. Example
  14. You want the user to be able to choose a MacPaint™ or a picture file. To do this, you write : 
  15.    `...
  16.    `The MacPaint™ file type is PNTG
  17.    `The Picture file type is PICT
  18.  
  19.    ChooseFile(FileName;"PNTGPICT")
  20.    If(FileName#"")
  21.    `a file has been choosen
  22.    else
  23.       `The user has clicked on cancel
  24.    End if
  25.  
  26. Important
  27. a) You cannot specify more than 4 types.  If you specify more than 4 parameters, the others are ignored.
  28.  
  29. b) ChooseFile works like SET CHANNEL(10;"") or SET CHANNEL(13;"") except it does not open the file. After calling ChooseFile, you can open the file by using SET CHANNEL(Var) where Var contains the complete path of the file.